



<div class="page-title">
    <img src="svg_img/system_black.svg">
    <h1 data-trans="ttyd"></h1>
</div>
<div id="innerContainer">
    <div class="limit-container">
        <form id="sambaForm">
            <div class="content">

                <div id="terminal-container" style="
                display: flex;
                justify-content: center;
                align-items: center;
                height: 60vh;
                width: 100%;
            ">
                    <iframe 
                        id="terminal-iframe" 
                        src="atwat/ttyd/" 
                        width="95%" 
                        height="100%" 
                        frameborder="0"
                        style="border-radius: 4px;"
                    ></iframe>
                </div>
                
            </div>
            <div class="form-note">
                <div class="notes-title">&nbsp;</div>
                <ul class="notes-content">
                    <li data-trans="ttyd_note"></li>
                    <button id="toggleSrcButton" style="padding: 5px 10px; font-size: 14px; background-color: #0f87f7; color: white; border: none; border-radius: 4px; cursor: pointer;">
                        切换源（当前源：atwat/ttyd/）
                    </button>
                </ul>
            </div>
        </form>
    </div>
</div>

<script>
    document.getElementById('toggleSrcButton').addEventListener('click', function() {
        var iframe = document.getElementById('terminal-iframe');
        var currentSrc = iframe.src;
        var newSrc;

        // Determine the new source based on the current source
        if (currentSrc.endsWith('atwat/ttyd/')) {
            newSrc = 'atwat/ttyd-root/';
        } else {
            newSrc = 'atwat/ttyd/';
        }

        // Update the iframe source
        iframe.src = newSrc;

        // Update the button text to reflect the new source
        this.textContent = `切换源（当前源：${newSrc}）`;
    });
</script>